<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:form>
	<p:panel header="#{message.label_formas_pag} - #{message.label_filtro}"
		style="position: relative; left:10%;">
		<h:panelGrid columns="6">

			<h:outputLabel style="margin-left: 30px;"
				value="#{message.label_metodo_pag}" />

			<p:inputText style="margin-left: 5px;" size="12"
				value="#{formaPagamentoTela.metodoPagFiltro}" />

			<h:outputLabel style="margin-left: 30px;"
				value="#{message.label_forma_pag}" />

			<p:inputText style="margin-left: 5px;" size="12"
				value="#{formaPagamentoTela.formaPagFiltro}" />

		</h:panelGrid>
		<p:commandButton value="#{message.botao_filtrar}"
			action="#{formaPagamentoTela.filtraFormas}" update=":formListaFormas">
		</p:commandButton>
	</p:panel>
</h:form>
<h:form id="formListaFormas">
	<p:dataTable value="#{formaPagamentoTela.listaFormas}" var="forma"
		emptyMessage="#{message.table_empty}"
		style="margin-top:20px; width:950px;" paginator="true" rows="5"
		rowKey="#{forma.idFormaPag}">

		<p:column>
			<f:facet name="header">
				<h:outputText value="#{message.label_codigo}" />
			</f:facet>
			<h:outputText value="#{forma.idFormaPag}" />
		</p:column>


		<p:column>
			<f:facet name="header">
				<h:outputText value="#{message.label_metodo_pag}" />
			</f:facet>
			<h:outputText value="#{forma.metodoPag}" />
		</p:column>

		<p:column>
			<f:facet name="header">
				<h:outputText value="#{message.label_forma_pag}" />
			</f:facet>
			<h:outputText value="#{forma.formaPag}" />
		</p:column>

		<p:column>
			<f:facet name="header">
				<h:outputText value="#{message.label_acoes}" />
			</f:facet>
			<p:commandButton id="exbForma" icon="ui-icon-trash"
				action="#{formaPagamentoTela.excluir(forma)}"
				update=":messages,@form">
			</p:commandButton>
			<p:commandButton id="edbForma" icon="ui-icon-pencil"
				oncomplete="dlgEdiFormaPag.show()" update=":editaFormaForm">
				<f:setPropertyActionListener target="#{formaPagamentoTela.forma}"
					value="#{forma}" />
			</p:commandButton>
			<p:tooltip for="exbForma" value="#{message.botao_excluir}" />
			<p:tooltip for="edbForma" value="#{message.botao_editar}" />
		</p:column>

	</p:dataTable>
</h:form>
</html>